package purchaseSystem;

public class purchaseManagementSystem {
    public static void main(String[] args) {
        package procurementSystem;

import procurementSystem.Service.ProcurementService;
import procurementSystem.model.PurchaseOrder;
import procurementSystem.model.PurchaseItem;
import procurementSystem.model.Supplier;

import java.util.List;
import java.util.Arrays;

public class ProcurementManagementSystem {
    public static void main(String[] args) {
        
        ProcurementService procurementService = new ProcurementService();

        
        PurchaseItem item1 = new PurchaseItem("MAT-1001", "键盘", 50, 120.00);
        PurchaseItem item2 = new PurchaseItem("MAT-1002", "鼠标", 200, 5.80);
        List<PurchaseItem> items = Arrays.asList(item1, item2);

        
        Supplier supplier = new Supplier("SUP-2023", "戴尔科技有限公司");

        
        PurchaseOrder order = procurementService.createPurchaseOrder("DEP-001", items, supplier);
        String poNumber = order.getPoNumber();
        
        procurementService.submitForApproval(poNumber);

        
        procurementService.approvePurchaseOrder(poNumber, "ADMIN001");

        
        procurementService.generateContract(poNumber);

        
        procurementService.confirmSupplierAcceptance(poNumber);

        
        procurementService.updateShippingInfo(poNumber, "SF-EXPRESS", "SF123456789");

        
        procurementService.confirmReceipt(poNumber);

        
        procurementService.processPayment(poNumber, "BANK_TRANSFER");

        
        PurchaseOrder currentOrder = procurementService.getPurchaseOrder(poNumber);
        System.out.println("\n最终采购单信息:");
        System.out.println("采购单号: " + currentOrder.getPoNumber());
        System.out.println("状态: " + currentOrder.getStatus());
        System.out.println("总金额: " + currentOrder.getTotalAmount());
        System.out.println("供应商: " + currentOrder.getSupplier().getName());
        System.out.println("物流单号: " + currentOrder.getTrackingNumber());
    }
}
    }
}
